package com.cll.prototype.mongodb.springboot;

import com.cll.prototype.mongodb.springboot.bean.ResumePreview;
import com.cll.prototype.mongodb.springboot.dao.ResumePreviewDao;
import com.cll.prototype.mongodb.springboot.repository.ResumePreviewRepository;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.List;

/**
 * 描述信息:
 *
 * @author CLL
 * @version 1.0
 * @date 2020/11/29 16:54
 */
@SpringBootApplication
public class MongodbApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(MongodbApplication.class);
//        ResumePreviewDao resumePreviewDao = applicationContext.getBean(ResumePreviewDao.class);
//        ResumePreview resumePreview = resumePreviewDao.findByName("王楠");
//        System.out.println("result = " + resumePreview.toString());

        ResumePreviewRepository resumePreviewRepository = applicationContext.getBean(ResumePreviewRepository.class);
//        List<ResumePreview> all = resumePreviewRepository.findAll();

//        List<ResumePreview> resumePreviews = resumePreviewRepository.findByNameEquals("王楠");
        List<ResumePreview> resumePreviews = resumePreviewRepository.findByNameAndExpectSalary("王楠", 15000D);

        System.out.println("result = " + resumePreviews);
    }
}
